{%extends 'template.html'%}

{%block username%}
{{head.username}}
{%endblock%}

{%block content%}
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">{{head.value}}</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="btn-group">
                        <!--<a><button id='bt-add' type="button" class="btn btn-primary">增加</button></a>-->
                        <!--<a><button id='bt-del' data-text="确定删除主机? 0个" type="button" class="btn btn-danger">删除</button></a>-->
                        <a><button id='bt-search' type="button" class="btn btn-success">高级搜索</button></a>
                        <a><button id='bt-reset' type="button" class="btn btn-danger">重置高级搜索</button></a>
                    </div>
                </div>
                <div class="panel-body">
                    <div id="div-search" class="hide">
                      <table id="high-search" style="width: 67%; margin: 0 auto 2em auto;" border="0" cellpadding="3" cellspacing="0">
                        <thead>
                            <tr>
                                <th>目标</th>
                                <th>内容</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                            <tr id="_filter_ctype" data-column="2">
                                <td>用户</td>
                                <td align="center">
                                <select id="filter_username" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for user in all_user %}
                                        <option value={{user.id}}>{{user.username}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>

                            <tr>
                                <td>主机标识符</td>
                                <td align="center">
                                <select id="filter_host" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for host in all_host %}
                                        <option value={{host.id}}>{{host.host_identifier}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>内网IP</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_internal_ip" type="text"></td>
                            </tr>

                            <tr>
                                <td>电信IP</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_telecom_ip" type="text"></td>
                            </tr>
                            <tr>
                                <td>联通IP</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_unicom_ip" type="text"></td>
                            </tr>
                            <tr>
                                <td>开始时间</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_start_time" type="text"></td>
                            </tr>
                            <tr>
                                <td>结束时间</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_end_time" type="text"></td>
                            </tr>
                            <tr>
                                <td>权限类型</td>
                                <td align="center">
                                <select id="filter_t_status" class="filter_select2" style="width: 100%">
                                      <option value="100" selected="selected">全部</option>
                                      {% for k, v in all_t_status.items %}
                                        <option value={{k}}>{{v}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            <tr>
                                <td>用户类型</td>
                                <td align="center">
                                <select id="filter_r_status" class="filter_select2" style="width: 100%">
                                      <option value="100" selected="selected">全部</option>
                                      {% for k, v in all_r_status.items %}
                                        <option value={{k}}>{{v}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            <tr>
                                <td>时效类型</td>
                                <td align="center">
                                <select id="filter_v_status" class="filter_select2" style="width: 100%">
                                      <option value="100" selected="selected">全部</option>
                                      {% for k, v in all_v_status.items %}
                                        <option value={{k}}>{{v}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            <tr>
                                <td>项目</td>
                                <td align="center">
                                <select id="filter_game_project" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for project in all_game_project %}
                                        <option value={{project.id}}>{{project.project_name}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            <tr>
                                <td>机房</td>
                                <td align="center">
                                <select id="filter_room" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for room in all_room %}
                                        <option value={{room.id}}>{{room.room_name}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                            <tr>
                                <td>部门</td>
                                <td align="center">
                                <select id="filter_group" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for group in all_group %}
                                        <option value={{group.id}}>{{group.name}}</option>
                                      {% endfor %}
                                </select>
                                </td>
                            </tr>
                        </tbody>
                      </table>
                    </div>
                      <table id="mytable" class="display" width="100%" cellspacing="0">
                          <thead>
                              <tr>
                                  <th>id</th>
                                  <th>用户</th>
                                  <th>主机</th>
                                  <th>主机状态</th>
                                  <th>IP</th>
                                  <th>开始时间</th>
                                  <th>结束时间</th>
                                  <th>时效</th>
                                  <th>用户类型</th>
                                  <th>有效性</th>
                              </tr>
                          </thead>
                      </table>
                </div>
            </div>
        </div>
    </div>
</div>
{%endblock%}
{%block bodyjs%}
    <script src="/static/js/jquery.dataTables.js" ></script>
    {{ django_context_varable }}
    {% verbatim %}
    <script id="tpl" type="text/x-handlebars-template">
          {{#each func}}
          <button type="button" class="btn btn-{{this.type}} btn-sm" onclick="{{this.fn}}">{{this.name}}</button>
          {{/each}}
    </script>
    {% endverbatim %}
    <script src="/static/js/handlebars-v3.0.1.js"></script>
    <script src="/static/js/user_host_list.js?v=1b11d6e43faee4cd6f6c5fc2ac8e91eeed836552"></script>
{%endblock%}
{%block css%}
<link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
<link href="/static/css/mycss.css" rel="stylesheet" type="text/css">
{%endblock%}
